﻿<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="h" uri="/WEB-INF/config/tag/feonix-tags.tld"%>
<!--_meta 作为公共模版分离出去-->
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<link rel="Shortcut Icon" href="favicon.ico" />
<!--/meta 作为公共模版分离出去-->
<title>complat</title>
<h:head pagetype="page" cookie="true" dialog="true" message="true" iconfont="true"></h:head>
<style type="text/css">
html,body {
	height: 100%;
	overflow: hidden;
}
body {
	margin: 0;
	padding: 0;
}
#menu-wrap {
	position: absolute;
	/* border-right: 3px solid #EFEFEF; */
	top: 53px;
	bottom: 0;
	left: 0;
	padding-top: 10px;
	width: 240px;
	z-index: 10;
	border-right: 3px solid #EFEFEF;
}
#menu {
	width: 100%;
	height: 100%;
}
	
#page-wrap {
	position: absolute;
	top:53px;
	right:0;
	bottom: 0;
	left:240px;
	overflow:hidden;
	z-index:1;
}
#page {
	width: 100%;
	height: 100%;
}
#sso {
	width: 100%;
	height: 3px;
	background-color: #ee1d24;
	/* 	background-image: linear-gradient(to right, rgb(85, 164, 242), */
	/* 		rgb(182, 212, 56) 50%, rgb(255, 194, 14)); */
	/* 	background-repeat: no-repeat; */
	/* 	background-color: rgb(197, 208, 48); */
	overflow: hidden;
	*overflow: hidden;
}

#header {
	width: 100%;
	background: url(${contextPath}/ui/resources/images/nav-bg.png) bottom repeat-x;
	box-shadow: 0 1px 5px #888;
	position: absolute;
	z-index: 20;
	_border-bottom: 1px solid #CCC;
}

#header-container {
	height: 50px;
	min-width: 960px;
	margin: 0 20px;
}

#logo {
	float: left;
	width: 280px;
	height: 50px;
	line-height: 50px;
	font-size: 36px;
	color: #FFF;
}

.nav-menu {
	float: right;
	height: 50px;
}

.nav-menu li {
	float: left;
	font-size: 15px;
	width: 110px;
	height: 100%;
	text-align: center;
	line-height: 50px;
	position: relative;
	z-index: 100;
}

.nav-menu div {
	width: 100%;
	height: 100%;
	cursor: default;
	overflow: hidden;
}

.nav-title {
	color: #333;
}

.nav-menu .hover {
 	background-color: #EFEFEF;
 	-webkit-transition: all 0.3s ease-out 0s;
	-moz-transition: all 0.3s ease-out 0s;
	transition: all 0.3s ease-out 0s;
}

.nav-menu .active {
	background-color: #ee1d24;
}

.nav-menu .active .nav-title {
	color: #FFF;
}

.nav-menu .separator {
	border-left: 1px solid #CCC;
	border-right: 1px solid #FFF;
	height: 50px;
	width: 0;
}

.nav-account-btn {
	line-height: 50px;
	font-size: 20px;
}

.nav-submenu {
	display: none;
	position: absolute;
	top: 50px;
	left: 0;
	background-color: #F9F9F9;
	border: 1px solid #CCC;
	border-bottom-left-radius: 5px;
	border-bottom-right-radius: 5px;
	box-shadow: 1px 2px 1px #EFEFEF;
}

.nav-submenu li {
	font-size: 15px;
	width: auto;
	min-width: 108px;
	_width: 108px;
	height: 36px;
	line-height: 36px;
	float: none;
	text-align: left;
	-webkit-transition: all 0.3s ease-out 0s;
	-moz-transition: all 0.3s ease-out 0s;
	transition: all 0.3s ease-out 0s;
}

.nav-submenu span {
	padding: 0 10px;
}

</style>
<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript">
var cookiePath = '${contextPath}/';
var height;
var channel = isNull($.cookie('channel'));
var menuUrl = isNull($.cookie('menuUrl'));
var pageUrl = isNull($.cookie('pageUrl'));
if(!pageUrl && !menuUrl){
	pageUrl = '${pageUrl}';
	menuUrl = '${menuUrl}';
}
$(function() {
	channel = channel ? channel : $('li[channel]').attr('channel');
	$('body').on('mousedown', '*', function() {
		if (typeof($dp) != 'undefined') {
			try {
				$dp.hide();//修复弹出框内的日历控件有时候关闭窗口不消失
			} catch(e) {
				
			}
		}
	});
	

	$('.nav-menu > li').hover(function() {
		$(this).not('.active').addClass('hover');
		$(this).children('.nav-submenu').slideDown(50);
	}, function() {
		$(this).not('.active').removeClass('hover');
		$(this).children('.nav-submenu').hide();
	});

	$('.nav-submenu > li').hover(function() {
		$(this).css('background-color', '#EFEFEF');
	}, function() {
		$(this).css('background-color', '');
	});

	$('li[channel=' + channel + ']').addClass('active');
	$('#page').attr('src', pageUrl);
	$('#menu').attr('src', menuUrl);
	height = $(window).height() - $('#header').outerHeight();

	$('#page-wrap').css('top', $('#header').outerHeight());

	initLayout();

	$(window).resize(function() {
		height = $(window).height() - $('#header').outerHeight();
		initLayout();
	});

	$('.nav-link[page]').click(function() {
		$('.active').removeClass('active');
		$('.hover').removeClass('hover');
		var currentNav = $(this).closest('li[channel]');
		currentNav.addClass('active');

		channel = currentNav.attr('channel');
		pageUrl = $(this).attr('page');
		menuUrl = $(this).attr('menu');
		menuUrl = menuUrl ? menuUrl : null;

		initLayout();

		$('#page').attr('src', pageUrl);
		$('#menu').attr('src', menuUrl);

		$.cookie('channel', channel, {path: cookiePath});
		$.cookie('pageUrl', pageUrl, {path: cookiePath});
		$.cookie('menuUrl', menuUrl, {path: cookiePath});
	});
});

/**
 * 设置布局
 */
function initLayout() {
	if (menuUrl) {
		$('#page-wrap').width($(top.window).width() - 240).height(height);
		$('#page-wrap').css("left", "240px");
		$('#menu-wrap').css({
			top : $('#header').outerHeight(),
			left : 'auto'
		}).show().height(height);
	} else {
		$('#page-wrap').width('100%').height(height);
		$('#page-wrap').css("left", "0");
		$('#menu-wrap').hide();
		
	}
}

/**
 * 判断数据是否是空
 */
function isNull(value){
	var result = value;
	if(value == null || value == "null" || value == "" || value == NaN || value == undefined){
		result = null;
	}
	return result;	
}


/**
 * 保持用户在线，20分钟一次
 */
 setInterval(function(){
	var url = '${contextPath}/manager/main/user/keep_online';
	ajaxSubmit(url, {
		type:'html',
		error:function(a,b,msg){
		}
	});
}, 1200000); 

</script>
<!--/请在上方写此页面业务相关的脚本-->
</head>
<body>
<!--_header 作为公共模版分离出去-->
	<div id="header">
		<div id="sso"></div>
		<div id="header-container">
			<div id="logo">
				<img src="../../ui/resources/images/logo2.png" style="height: 34px; margin-top: 8px;" />
			</div>
			<!-- <ul class="nav-menu">
				<li channel="index" class="active" style="">
					<div onclick="" page="/complat/manager/home/index.do" class="nav-title nav-link">首页</div>
				</li>
			</ul> -->
			${topMenuHtml}
		</div>
	</div>
<!--/_header 作为公共模版分离出去-->

<!--_menu 作为公共模版分离出去-->
	<div id="menu-wrap">
		<iframe name="menu" id="menu" frameborder="0" ></iframe>
	</div>
<!--/_menu 作为公共模版分离出去-->

<!-- page 作为公共模板分离出去 -->
	<div id="page-wrap">
		<iframe name="page" id="page" frameborder="0" ></iframe>
	</div>
<!-- /page 作为公共模板分离出去  -->
</body>
</html>